package cc.sheji.domain;

import cc.sheji.annotation.Query;
import lombok.Data;
import javax.validation.groups.Default;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;

@Data
public class UserQueryCriteria {

    @Query
    public Long id;
    @Query(type = Query.Type.INNER_LIKE)
    public String name;
    @Query(type = Query.Type.INNER_LIKE)
    public String phone;
    @Query(type = Query.Type.GREATER_THAN)
    public Integer productNum;
    @Query(type = Query.Type.BETWEEN)
    public ArrayList<Timestamp> createTime;
    public Integer type;
    @Query(type = Query.Type.GREATER_THAN)
    public Date vip1Time;
    @Query(type = Query.Type.GREATER_THAN)
    public Date vip2Time;
    @Query(type = Query.Type.GREATER_THAN)
    public Date vip3Time;
    @Query(type = Query.Type.GREATER_THAN)
    public Date vip4Time;
    Integer isVip;
    Integer orderBy;

    public void setIsVip(Integer isVip) {
        this.isVip = isVip;
        if(isVip!=null&&isVip==1){
//           this.vip1Time=new Date();
//            this.vip2Time=new Date();
//            this.vip3Time=new Date();
            this.vip4Time=new Date();
        }
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public interface AddeGroup extends Default{

    }
    public interface UpdateGroup extends Default{

    }
}
